//
//  MeatPriceTableViewCell.m
//  PigMarket
//
//  Created by 张敬 on 2019/7/30.
//  Copyright © 2019年 pigmarket.oc. All rights reserved.
//

#import "MeatPriceTableViewCell.h"

@interface MeatPriceTableViewCell()


@end


@implementation MeatPriceTableViewCell

- (void)setupUI{
    
    [self addSubview:self.typeNameLab];
    [self addSubview:self.whitePriceLab];
    [self addSubview:self.blackPriceLab];
}

- (void)setupLayout{
    
    _typeNameLab.size = _whitePriceLab.size = _blackPriceLab.size = CGSizeMake(KScreenWidth/3.0, 20);
    
    {
        _typeNameLab.mj_x = 0;
        _typeNameLab.mj_y = (self.height - self.typeNameLab.height)/2.0;
    }
    
    {
        _blackPriceLab.mj_x = _typeNameLab.right;
        _blackPriceLab.mj_y = _typeNameLab.mj_y;
    }
    
    {
        _whitePriceLab.mj_x = _blackPriceLab.right;
        _whitePriceLab.mj_y = _typeNameLab.mj_y;
    }
}



#pragma mark -  setter and getter methods

- (void)setType:(MeatPriceTableViewCellType)type{
    
    switch (type) {
        case MeatPriceTableViewCellType_Blod:
        {
            _typeNameLab.textColor = _blackPriceLab.textColor = _whitePriceLab.textColor = UIColorFromRGB(0x333333);
            _typeNameLab.font = _blackPriceLab.font = _whitePriceLab.font = mMediumFont(14);
            
            break;
            
        default:
            {
                _typeNameLab.textColor = _blackPriceLab.textColor = _whitePriceLab.textColor = UIColorFromRGB(0x4D4D4D);
                _typeNameLab.font = _blackPriceLab.font = _whitePriceLab.font = mMediumFont(13);
            }
            break;
        }
    }
}

    
- (UILabel *)typeNameLab{
    
    if (!_typeNameLab) {
        _typeNameLab = [UILabel new];
        _typeNameLab.textAlignment = NSTextAlignmentCenter;
    }
    return _typeNameLab;
}


- (UILabel *)blackPriceLab{
    
    if (!_blackPriceLab) {
        _blackPriceLab = [UILabel new];
        _blackPriceLab.textAlignment = NSTextAlignmentCenter;

    }
    return _blackPriceLab;
}


- (UILabel *)whitePriceLab{
    
    if (!_whitePriceLab) {
        _whitePriceLab = [UILabel new];
        _whitePriceLab.textAlignment = NSTextAlignmentCenter;
    }
    return _whitePriceLab;
}



@end
